﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Client_Web.ServiceReference;

namespace Client_Web.Gallery
{
    public partial class PictureView : System.Web.UI.Page
    {
        protected PictureStruct picture;

        protected void Page_Load(object sender, EventArgs e)
        {
            picture = new PictureStruct();
            picture.id = Request.QueryString["pictureId"];
            if (null != picture.id)
            {
                ServiceClient serviceClient = new ServiceClient();

                string[] data = Util.CleanAndSplit(serviceClient.getPictureInfo(picture.id));
                picture.name = data[1];
                picture.date = data[2];

                CurrentImage.ImageUrl = "~/Gallery/Picture.aspx?pictureId=" + picture.id;
                Title = "Image #" + picture.id + "&nbsp;-&nbsp;" + picture.name;
            }
        }
    }
}